<?php $this->_extends('_layouts/default_layout'); ?>
 
<?php $this->_block('contents'); ?>
 
<div class="tasks">
 
  <h1>地址</h1>
  <a href="<?php echo url('address/create'); ?>">添加收货地址</a>
  
  <hr />
  
  <?php foreach ($address as $address): ?>
 
  <h2><a href="<?php echo url('address/edit', array('address_id' => $address->address_id)); ?>"><?php echo h($address->name); ?></a></h2>
  <a href="<?php echo url('address/delete', array('address_id' => $address->id())); ?>" onclick="return confirm('您确定要删除该地址吗？');">删除该地址</a>
  <p class="address">
	<?php echo nl2br(h($address->district)); ?> &nbsp &nbsp <?php echo nl2br(h($address->street)); ?> <br>
	电话：<?php echo nl2br(h($address->cellphone)); ?>
  </p> 

  <p class="meta">
    <?php if ($address->is_default): ?>
    <em>这是您的默认收货地址</em>
    <?php else: ?>
    <strong><a href="<?php echo url('address/setdefault', array('address_id' => $address->address_id));?>">设为默认收货地址</a> </strong>
    <?php endif; ?>
  </p>

  <hr />
 
  <?php endforeach; ?>
 
</div>
 
<?php $this->_endblock(); ?>
